<template>
	<view class="hui">
		<view class="box">
			<view class="b_flex_c">
				<view class="xian"></view>
				<view class="b_f_w">员工账户</view>
			</view>
			
			
			<view class="user_box b_flex_c" v-for="(item,index) in list" :key="index">
				<image class="img" :src="item.avatar"></image>
				<view>
					<view class="b_flex_c">
						<view class="mr">{{item.nickname}}</view>
						<view>{{item.mobile}}</view>
					</view>
					<view class="mt">
						<text class="group">
							{{item.group}}
						</text>
					</view>
					<view class="fc" v-if="item.fc">提货点: {{item.fc.name}}</view>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	import {
		adminList
	} from '@/require/api';
	export default {
		data() {
			return {
				params: {
					page: 1
				},
				list: [],
				total: 0,
				emptyShow:false
			}
		},
		methods:{
			async getList() {
				this.params.page = 1;
				let {
					data
				} = await adminList(this.params);
				if ( !data.data || data.data.length < 1 ) {
					this.emptyShow = true;
				} else {
					this.emptyShow = false;
				}
				this.list = data.data;
				this.total = data.total;
			}
		},
		onReachBottom() {
			if (this.list.length < this.total) {
				this.params.page++;
				insp(this.params).then(res => {
					res.data.data.forEach((res) => {
						this.list.push(res);
					});
				});
			}
		},
		onLoad() {
			this.getList();
		}
	}
</script>

<style lang="scss" scoped>
	.xian {
		background-color: #3593FE;
		width: 8rpx;
		height: 35rpx;
		border-radius: 25rpx;
		margin-right: 15rpx;
	}

	.box {
		box-sizing: border-box;
		padding: 30rpx 20rpx;
	}
	.user_box{
		border-radius: 15rpx;
		background-color: white;
		box-sizing: border-box;
		padding: 15rpx;
		margin-top: 20rpx;
		font-size: 29rpx;
	}
	.img{
			width: 110rpx;
			height: 110rpx;
			border-radius: 50%;
			margin-right: 20rpx;
			
		}
		.mr{
			margin-right: 10rpx;
		}
		.mt{
			margin-top: 15rpx;
		}
		
		.group{
			background-color: #FCF4E3;
			border: 1rpx solid #E8E7C6;
			color: #EBB139;
			box-sizing: border-box;
			padding: 3rpx 10rpx;
			border-radius: 10rpx;
			font-size: 24rpx;
			
		}
		.fc{
			margin-top: 15rpx;
			font-size: 28rpx;
		}
</style>